<?php
declare (strict_types = 1);

namespace app\admin\controller;

class Index extends \app\admin\controller\Base
{
  public function index()
  {
    return '';
  }

  //收益情况
  public function getProfitData()
  {
    $rows = [];
    $vo = [];
    $vo['name'] = '总收益';
    $vo['value'] = rand(1000,999);
    $rows[] = $vo;

    $vo = [];
    $vo['name'] = '实际支出';
    $vo['value'] = rand(1000,999);
    $rows[] = $vo;

    $vo = [];
    $vo['name'] = '待提现';
    $vo['value'] = rand(1000,999);
    $rows[] = $vo;
    
    return $this->doSuccess('ok',$rows);
  }

  //收益报表
  public function reprotProfit()
  {
    $date = [];
    $meituan_date = [];
    $ele_date = [];
    for ($i=0; $i < 7; $i++) { 
      $day = date('m月d日',strtotime("-{$i} day"));
      $date[] = $day;
      $meituan_date[] = rand(209,999);
      $ele_date[] = rand(209,999);
    }
    $vo['date'] = $date;
    $vo['meituan_date'] = $meituan_date;
    $vo['ele_date'] = $ele_date;
    return $this->doSuccess('ok',$vo);
  }

  //版权信息
  public function copyright()
  {
    $vo['code'] = 'wx6265c48668336a67';
    $vo['etime'] = '2021年09月18日';
    $vo['domain'] = 'waimai.tieninc.com';
    $vo['admimn_version'] = '20200918';
    $vo['mini_version'] = '20200918';
    return $this->doSuccess('ok',$vo);
  }

  public function infos()
  {
    $rows = [];
    for ($i=0; $i < 7; $i++) { 
      $vo = [
        'title'=>"官方更新日志测试",
        'url'=>"https://www.baidu.com",
        'date'=>"2020年09月18日",
      ];
      $rows[] = $vo;
    }
    return $this->doSuccess('ok',$rows);
  }

  //官方公告
  public function news()
  {
    $rows = [];
    for ($i=0; $i < 7; $i++) { 
      $vo = [
        'title'=>"官方更新日志测试",
        'url'=>"https://www.baidu.com",
        'date'=>"2020年09月18日",
      ];
      $rows[] = $vo;
    }
    return $this->doSuccess('ok',$rows);
  }
}
